package com.examfeign.FeignService;

import com.examfeign.VO.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

/**
 * @author :admin
 * @description: TODO edit class Description
 * @create date: 2019/4/14 17:02
 */
@FeignClient(name = "exam")
@Service
public interface FeignServiceExamService {

    @RequestMapping(value = "/feign/hello/{name}", method = RequestMethod.GET)
    public String hello(@PathVariable("name") String name);
    //这里在定义各参数绑定时，@RequestParam, @RequestHeader，@PathVariable等可以指定参数名称的注解，它们的value不可省略

    @RequestMapping(value = "/feign/helloUser", method = RequestMethod.GET)
    public User helloUser(@RequestHeader("name") String name, @RequestHeader("age") Integer age) ;

    @RequestMapping(value = "/feign/getHelloUser", method = RequestMethod.POST)
    public String getHelloUser(@RequestBody User user);
}
